MacOS X Developer Preview 4 Release Notes Copyright © 2000 by Apple Computer, Inc. All Rights Reserved.
MacOS X Developer Release Notes:
InterfaceBuilder
Aqua views have shadows within their frame; InterfaceBuilder introduces the "Layout Rectangle" as the NSRect within the [view frame] that visually represents the widget without its shadow. Using this layout rect, IB can visually align Aqua views.
In the Size Inspector for all cocoa views a popup toggles the display of size/origin data between frame and layout rectangle information. This popup's state will persist during and between sessions of InterfaceBuilder; its default is to show layout rectangle information.
When using the alignment panel to align the edges or centers of widgets, InterfaceBuilder will use the layout rectangle to visually align views. An application preference, defaulting to use layout rectangles, can be used to change this behavior. See "Use layout rect for layout" in the General preferences.
Notes
NSMatrix will inset its layout rectangle from its frame using the
same distances that its prototype cell uses; a matrix containing like
cells (of the same class and appearance) will properly align with
other views and window edges.
Known Problems
- Same size does not use the layout rectangles, use the size inspector as a workaround.
(Only works for Cocoa)
A new menu item under the top level "Layout" menu can be used to "Apply Layout Guidelines" to a window, to the main menu or to the entire nib file. This menu item helps developers transition from pre-Aqua nib files.
Applying layout guidelines to a window will change the font size of system fonts to 13 point and resize views to properly fit their new font. Any views with minimum sizes are sized to atleast these minimum sizes. IB will try to preserve all inter-view distances aftering resizing views. Each nib may require manual layout work after using "Apply Layout Guidelines".
Applying layout guidelines to the main menu by selecting the menu window when no menus are selected (close menu window, double-click menu icon in documnet window) and use the "Apply UI Guidelines" menu item.
NSTabView
Moving tab view tab items with the arrow keys will now display properly. The NSTabView editor enables developers to rearrange the NSTabViewItems by using the left/right arrow keys to move the selected tab (make sure the tab view item is selected by clicking on the tab item's label). Prior to DP4, the visual feedback for this change was misleading.
NSButton inspector
The NSButton inspector now supports changing the control tint of buttons. See the layout guidelines for when to use "Default Control Tint" to highlight the main button within an interface and when to use the "Clear Control Tint" on all other buttons.
Window Inspector
NSMatrix Inspector
NIB changes (IMPORTANT)
Because of the additions of the FrameAutosaveName and the maximum window size NIB files saved with the DP4 version of InterfaceBuilder won't open using previous version (DP3 and earlier). For the same reasons Cocoa applications using DP4 Nib files won't run on DP3 and earlier version.
NSDrawer
NSDrawer, an AppKit object subclassed from NSResponder (not an NSView subclass), was added to the Cocoa-Windows palette. This object will place an NSView, determined by the contentView outlet, into a drawer window that can slide from behind a window, determined by the parentWindow outlet. Two actions on NSDrawer allow controlling the drawer window: -open: and -close:.
The palette has two objects that contain NSDrawer objects: a simple NSDrawer object and a group of objects containing an NSDrawer object with its parentWindow and contentView objects and the connections between these objects.
Note: the contentView is an invisible NSBox instance in a window titled "Window" and labeled, in the document window, "Drawer Content". Be sure to select and open this NSBox object so that objects dragged in or copied to the "Drawer Content" window go into the invisible NSBox instance.
Graphics palette
A New palette in IB contains custom views representing new NSView subclasses in the AppKit: NSOpenGLView and NSQuickDrawView.
DP3 was the first release of InterfaceBuilder with support for Carbon. With DP4, IB Carbon support is 98% complete.
The following UI elements are fully supported in DP3:
Missing:
Not supported yet
Also, it is not possible in this release to browse the content of resource files for icons or pictures resources. Only system icons and pictures are currently displayed in the Images tab.
The control inspector reports the size of the control bounds (the real carbon control). Aqua shadows are drawn outside of the control bounds and are not reported in the size.
The Runtime API for has not changed since DP3. The name of the header has changed, it is now IBCarbonRuntime.h and is part of the Carbon framework umbrella. By simply including Carbon.h you will have access to those APIs.
To recreate UI elements from a nib file a Carbon application needs to use a small new set of API. In DP3 this API is provided by the IBCarbonRuntime framework. Post DP3 the IBCarbonRuntime framework will be merged into Carbon. The API will be the same, only the containing framework will change. IBCarbonRuntime.framework will be obsolete.
OSErr CreateNibReferenceWithNibName(CFStringRef nibName, IBNibRef *outNibRef);
void DisposeNibReference(IBNibRef nibRef);
Call CreateNibReferenceWithNibName to create a nib reference. Pass in the name of the nib file (without the .nib extension). Any toolbox errors can be returned. The error kIBCarbonRuntimeCantFindNibFile (-10960) means that the nib named "nibName" could not be found in the application bundle.
Call DisposeNibReference once your are done with a nib reference.
OSErr CreateWindowFromNib(IBNibRef inNibRef, CFStringRef inName, WindowRef *outWindow);
Call CreateWindowFromNib to create a Carbon window from a nib. Pass in the nib reference created with CreateNibReferenceWithNibName and a name which is the name assigned to this particular window in InterfaceBuilder.
OSErr CreateMenuBarFromNib(IBNibRef inNibRef, CFStringRef inName, Handle* outMenuBar);
OSErr SetMenuBarFromNib(IBNibRef inNibRef, CFStringRef inName);
Call CreateMenuBarFromNib to instantiate and get a handle to a menu bar. You are responsible to dispose this handle.
Call SetMenuBarFromNib to instantiate a menu bar and directly set it as the main menu bar.
Both calls take a nib reference created with CreateNibReferenceWithNibName and a name which is the name assigned to the menu bar in InterfaceBuilder.
IBNibRef nibRef; WindowRef window; if (CreateNibReferenceWithNibName(CFSTR("mainNib"), &nibRef) == noErr) { SetMenuBarFromNib(nibRef, CFSTR("mainMenu")); CreateWindowFromNib(nibRef, CFSTR("mainWindow"), &window); DisposeNibReference(nibRef); ShowWindow(window); }
Look at the "Carbon Application (nib-based)" ProjectBuilder template for a running Carbon application using Nib files.
Carbon, at runtime, automatically populates the application menu with the Preferences, Services, Hide and Quit menu items. For this reason the IB Carbon templates and menu palette don't show those menu items.
It's helpful to understand how InterfaceBuilder employs user panes and embedding to create a Carbon tab control. Although InterfaceBuilder can't drive your tab control at runtime, it does a few things which make doing it yourself easier.
For each tab item you create, InterfaceBuilder will construct an associated user pane. All widgets placed inside the tab item will then be embedded inside that user pane. You can use the Tab View Item inspector to change the signature for each user pane.
Unlike the control in Cocoa, the Carbon tab control doesn't actually contain your tab views, so it's up to you to find them via their signatures and hide and show them as necessary (see new IBCarbonSample examples)
Other interesting notes about InterfaceBuilder Tab Controls:
1) You can rearrange tab items by selecting one and pressing the
left or right arrow keys.
2) You can make more by coping and pasting existing tab items.
3) New Carbon tab items can be made via the Carbon Tab Control
inspector.
The image tab in the document window only displays a very small set of icons available in the System. Currently we are displaying Platinum looking icons, this is a bug. This will be fixed in the next release. We will also be supporting IconRefs and when developing with Project Builder, will also be displaying icons and pictures that are part of your projects.
A new ProjectBuilder project type has been added ("Carbon Application (nib-based)"). It provides a skeleton Carbon Application with one Nib file containing one window and a standard menu bar.
A new IBCarbonSample project has been added in /System/Developer/Examples/InterfaceBuilder/. This is a carbon sample using the new ProjectBuilder showing how to deal with Carbon Tab View.
Note that both InterfaceBuilder samples are now using the new ProjectBuilder
When writting a XML nib file InterfaceBuilder does not correctly encode Entity References. The result is that characters &, <, >, ", and ' cannot be used in strings. If a nib file is written with one of those characters InterfaceBuilder won't be able to reopen it. In this case using any text editor open the objects.xib file inside your xxxx.nib file and search for those characteres between the tags <string name="xxxx"> and </string>.
For example
<string name="title">One & Two<string>
will cause an error.
DP4 is the first release to include the Apple's updated ProjectBuilder. The previous version has been renamed ProjectBuilder WO. We are working towards having the same level of integration with ProjectBuilder as exists with ProjectBuilder WO.
Currently InterfaceBuilder supports:
InterfaceBuilder doesn't yet support:
- Object are now resized live instead of simply dragging an outline
- InterfaceBuilder's preferences are now stored within the defaults domain "com.apple.InterfaceBuilder"; when first launching InterfaceBuilder in DP4, a users defaults will be copied from the domain "InterfaceBuilder". From then on DP4's InterfaceBuilder defaults will be independent of preferences used or changed by older versions of InterfaceBuilder.
- You can now set the name (Cocoa) or resource ID(Carbon) of an image in IB without having IB being able to locate this image at design time. In previous version of InterfaceBuilder this was not possible. Altough interesting by itself this new feature was required by the fact that the new ProjectBuilder doesn't yet keep track of resources and doesn't communicate there location to IB like the old PB used to.